Optimal. Leaf size=383 \[ \frac {2 (B+i A) \sqrt {\tan (c+d x)} (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n F_1\left (\frac {1}{2};1-n,1;\frac {3}{2};-i \tan (c+d x),i \tan (c+d x)\right )}{d}-\frac {2 \left (4 B n \left (2 n^2+8 n+9\right )+i A \left (8 n^3+32 n^2+36 n+15\right )\right ) \sqrt {\tan (c+d x)} (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n \, _2F_1\left (\frac {1}{2},1-n;\frac {3}{2};-i \tan (c+d x)\right )}{d (2 n+1) (2 n+3) (2 n+5)}-\frac {2 \left (B \left (4 n^2+10 n+15\right )+2 i A n (2 n+5)\right ) \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))^n}{d (2 n+1) (2 n+3) (2 n+5)}-\frac {2 (-A (2 n+5)+2 i B n) \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^n}{d (2 n+3) (2 n+5)}+\frac {2 B \tan ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^n}{d (2 n+5)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 1.14, antiderivative size = 383, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 9, integrand size = 36, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3597, 3601, 3564, 130, 430, 429, 3599, 66, 64} \[ \frac {2 (B+i A) \sqrt {\tan (c+d x)} (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n F_1\left (\frac {1}{2};1-n,1;\frac {3}{2};-i \tan (c+d x),i \tan (c+d x)\right )}{d}-\frac {2 \left (4 B n \left (2 n^2+8 n+9\right )+i A \left (8 n^3+32 n^2+36 n+15\right )\right ) \sqrt {\tan (c+d x)} (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n \, _2F_1\left (\frac {1}{2},1-n;\frac {3}{2};-i \tan (c+d x)\right )}{d (2 n+1) (2 n+3) (2 n+5)}-\frac {2 \left (B \left (4 n^2+10 n+15\right )+2 i A n (2 n+5)\right ) \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))^n}{d (2 n+1) (2 n+3) (2 n+5)}-\frac {2 (-A (2 n+5)+2 i B n) \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^n}{d (2 n+3) (2 n+5)}+\frac {2 B \tan ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^n}{d (2 n+5)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 64
Rule 66
Rule 130
Rule 429
Rule 430
Rule 3564
Rule 3597
Rule 3599
Rule 3601
Rubi steps
\begin {align*} \int \tan ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^n (A+B \tan (c+d x)) \, dx &=\frac {2 B \tan ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^n}{d (5+2 n)}+\frac {2 \int \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^n \left (-\frac {5 a B}{2}-\frac {1}{2} a (2 i B n-A (5+2 n)) \tan (c+d x)\right ) \, dx}{a (5+2 n)}\\ &=-\frac {2 (2 i B n-A (5+2 n)) \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^n}{d (3+2 n) (5+2 n)}+\frac {2 B \tan ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^n}{d (5+2 n)}+\frac {4 \int \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))^n \left (\frac {3}{4} a^2 (2 i B n-A (5+2 n))-\frac {1}{4} a^2 \left (2 i A n (5+2 n)+B \left (15+10 n+4 n^2\right )\right ) \tan (c+d x)\right ) \, dx}{a^2 (3+2 n) (5+2 n)}\\ &=-\frac {2 \left (2 i A n (5+2 n)+B \left (15+10 n+4 n^2\right )\right ) \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))^n}{d (1+2 n) (3+2 n) (5+2 n)}-\frac {2 (2 i B n-A (5+2 n)) \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^n}{d (3+2 n) (5+2 n)}+\frac {2 B \tan ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^n}{d (5+2 n)}+\frac {8 \int \frac {(a+i a \tan (c+d x))^n \left (\frac {1}{8} a^3 \left (2 i A n (5+2 n)+B \left (15+10 n+4 n^2\right )\right )+\frac {1}{8} a^3 \left (4 i B n \left (9+8 n+2 n^2\right )-A \left (15+36 n+32 n^2+8 n^3\right )\right ) \tan (c+d x)\right )}{\sqrt {\tan (c+d x)}} \, dx}{a^3 (1+2 n) (3+2 n) (5+2 n)}\\ &=-\frac {2 \left (2 i A n (5+2 n)+B \left (15+10 n+4 n^2\right )\right ) \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))^n}{d (1+2 n) (3+2 n) (5+2 n)}-\frac {2 (2 i B n-A (5+2 n)) \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^n}{d (3+2 n) (5+2 n)}+\frac {2 B \tan ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^n}{d (5+2 n)}+(i A+B) \int \frac {(a+i a \tan (c+d x))^n}{\sqrt {\tan (c+d x)}} \, dx-\frac {\left (4 B n \left (9+8 n+2 n^2\right )+i A \left (15+36 n+32 n^2+8 n^3\right )\right ) \int \frac {(a-i a \tan (c+d x)) (a+i a \tan (c+d x))^n}{\sqrt {\tan (c+d x)}} \, dx}{a (1+2 n) (3+2 n) (5+2 n)}\\ &=-\frac {2 \left (2 i A n (5+2 n)+B \left (15+10 n+4 n^2\right )\right ) \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))^n}{d (1+2 n) (3+2 n) (5+2 n)}-\frac {2 (2 i B n-A (5+2 n)) \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^n}{d (3+2 n) (5+2 n)}+\frac {2 B \tan ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^n}{d (5+2 n)}-\frac {\left (a^2 (A-i B)\right ) \operatorname {Subst}\left (\int \frac {(a+x)^{-1+n}}{\sqrt {-\frac {i x}{a}} \left (-a^2+a x\right )} \, dx,x,i a \tan (c+d x)\right )}{d}-\frac {\left (a \left (4 B n \left (9+8 n+2 n^2\right )+i A \left (15+36 n+32 n^2+8 n^3\right )\right )\right ) \operatorname {Subst}\left (\int \frac {(a+i a x)^{-1+n}}{\sqrt {x}} \, dx,x,\tan (c+d x)\right )}{d (1+2 n) (3+2 n) (5+2 n)}\\ &=-\frac {2 \left (2 i A n (5+2 n)+B \left (15+10 n+4 n^2\right )\right ) \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))^n}{d (1+2 n) (3+2 n) (5+2 n)}-\frac {2 (2 i B n-A (5+2 n)) \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^n}{d (3+2 n) (5+2 n)}+\frac {2 B \tan ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^n}{d (5+2 n)}-\frac {\left (2 a^3 (i A+B)\right ) \operatorname {Subst}\left (\int \frac {\left (a+i a x^2\right )^{-1+n}}{-a^2+i a^2 x^2} \, dx,x,\sqrt {\tan (c+d x)}\right )}{d}-\frac {\left (\left (4 B n \left (9+8 n+2 n^2\right )+i A \left (15+36 n+32 n^2+8 n^3\right )\right ) (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n\right ) \operatorname {Subst}\left (\int \frac {(1+i x)^{-1+n}}{\sqrt {x}} \, dx,x,\tan (c+d x)\right )}{d (1+2 n) (3+2 n) (5+2 n)}\\ &=-\frac {2 \left (2 i A n (5+2 n)+B \left (15+10 n+4 n^2\right )\right ) \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))^n}{d (1+2 n) (3+2 n) (5+2 n)}-\frac {2 \left (4 B n \left (9+8 n+2 n^2\right )+i A \left (15+36 n+32 n^2+8 n^3\right )\right ) \, _2F_1\left (\frac {1}{2},1-n;\frac {3}{2};-i \tan (c+d x)\right ) (1+i \tan (c+d x))^{-n} \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))^n}{d (1+2 n) (3+2 n) (5+2 n)}-\frac {2 (2 i B n-A (5+2 n)) \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^n}{d (3+2 n) (5+2 n)}+\frac {2 B \tan ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^n}{d (5+2 n)}-\frac {\left (2 a^2 (i A+B) (1+i \tan (c+d x))^{-n} (a+i a \tan (c+d x))^n\right ) \operatorname {Subst}\left (\int \frac {\left (1+i x^2\right )^{-1+n}}{-a^2+i a^2 x^2} \, dx,x,\sqrt {\tan (c+d x)}\right )}{d}\\ &=-\frac {2 \left (2 i A n (5+2 n)+B \left (15+10 n+4 n^2\right )\right ) \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))^n}{d (1+2 n) (3+2 n) (5+2 n)}+\frac {2 (i A+B) F_1\left (\frac {1}{2};1-n,1;\frac {3}{2};-i \tan (c+d x),i \tan (c+d x)\right ) (1+i \tan (c+d x))^{-n} \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))^n}{d}-\frac {2 \left (4 B n \left (9+8 n+2 n^2\right )+i A \left (15+36 n+32 n^2+8 n^3\right )\right ) \, _2F_1\left (\frac {1}{2},1-n;\frac {3}{2};-i \tan (c+d x)\right ) (1+i \tan (c+d x))^{-n} \sqrt {\tan (c+d x)} (a+i a \tan (c+d x))^n}{d (1+2 n) (3+2 n) (5+2 n)}-\frac {2 (2 i B n-A (5+2 n)) \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^n}{d (3+2 n) (5+2 n)}+\frac {2 B \tan ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^n}{d (5+2 n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [F] time = 16.36, size = 0, normalized size = 0.00 \[ \int \tan ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^n (A+B \tan (c+d x)) \, dx \]
Verification is Not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 1.20, size = 0, normalized size = 0.00 \[ {\rm integral}\left (-\frac {{\left ({\left (A - i \, B\right )} e^{\left (6 i \, d x + 6 i \, c\right )} - {\left (A - 3 i \, B\right )} e^{\left (4 i \, d x + 4 i \, c\right )} - {\left (A + 3 i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + A + i \, B\right )} \left (\frac {2 \, a e^{\left (2 i \, d x + 2 i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{n} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}}{e^{\left (6 i \, d x + 6 i \, c\right )} + 3 \, e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, e^{\left (2 i \, d x + 2 i \, c\right )} + 1}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \tan \left (d x + c\right ) + A\right )} {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n} \tan \left (d x + c\right )^{\frac {5}{2}}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 1.79, size = 0, normalized size = 0.00 \[ \int \left (\tan ^{\frac {5}{2}}\left (d x +c \right )\right ) \left (a +i a \tan \left (d x +c \right )\right )^{n} \left (A +B \tan \left (d x +c \right )\right )\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \tan \left (d x + c\right ) + A\right )} {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n} \tan \left (d x + c\right )^{\frac {5}{2}}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int {\mathrm {tan}\left (c+d\,x\right )}^{5/2}\,\left (A+B\,\mathrm {tan}\left (c+d\,x\right )\right )\,{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^n \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________